package com.iotechn.unimall.data.mapper;

import com.iotechn.unimall.data.domain.CardOrderDO;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.iotechn.unimall.data.dto.userCard.CardOrderInfoDTO;
import com.iotechn.unimall.data.dto.userCard.UserCardOrderDTO;
import org.apache.ibatis.annotations.Param;

import javax.annotation.security.PermitAll;
import java.util.Date;
import java.util.List;


/**
 * 
 * 
 * @author chen
 * @email 1197346512@qq.com
 * @date 2021-06-09 10:56:31
 */
public interface CardOrderMapper extends BaseMapper<CardOrderDO> {

    List<CardOrderInfoDTO> cardOrderInfoStoreApp(@Param("startTime") Date startTime, @Param("endTime") Date endTime,@Param("limit") Integer limit,@Param("page") Integer page, @Param("search") String search);

    List<CardOrderDO> selectOrderDetailList(
            @Param("cardPhone") String cardPhone,
            @Param("cardNo") String cardNo,
            @Param("cardOrderNo") String cardOrderNo,
            @Param("status") Integer status,
            @Param("storeId") Long storeId,
            @Param("startTime") Date startTime,
            @Param("endTime") Date endTime,
            @Param("limit") Integer limit,
            @Param("page") Integer page
            );

    Integer selectOrderDetailCount(
            @Param("cardPhone") String cardPhone,
            @Param("cardNo") String cardNo,
            @Param("cardOrderNo") String cardOrderNo,
            @Param("status") Integer status,
            @Param("storeId") Long storeId,
            @Param("startTime") Date startTime,
            @Param("endTime") Date endTime
    );


    UserCardOrderDTO getCardOrderTicket(@Param("cardOrderId") Long cardOrderId);

    Integer checkCardIsShop(@Param("cardNo") String cardNo);

}
